package com.totem.admin.api;

import com.totem.admin.vo.*;
import com.totem.base.model.Result;
import com.totem.customer.vo.GlobalConfigCacheVO;
import com.totem.startup.InitialGlobalConfig;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@Tag(name="AdminServiceApi", description="管理基础服务")
public interface AdminServiceApi {
    @Operation(summary="管理端系统级配置信息", description="返回公钥用于加密对称密钥")
    @GetMapping("/admin/config/system")
    @ResponseBody
    Result<ServerConfigVO> systemConfig();

    @Operation(summary="管理端应用级配置信息", description="管理后台配置的应用级配置")
    @GetMapping("/admin/config/app")
    @ResponseBody
    Result<AppConfigListVO> appConfig();

    @Operation(summary="管理端应用配置缓存", description="不包括认购包完整配置")
    @GetMapping("/admin/config/cache")
    @ResponseBody
    Result<GlobalConfigCacheVO> globalConfigCache();

    @Operation(summary="修改认购包配置", description="管理后台配置的认购包配置")
    @PostMapping("/admin/config/subscribe/update")
    @ResponseBody
    Result<Boolean> updateSubscribeConfig(@RequestBody UpdateSubscribeVO updateSubscribeVO);

    @Operation(summary="修改其他应用配置", description="管理后台配置的应用级配置")
    @PostMapping("/admin/config/app/update")
    @ResponseBody
    Result<Boolean> updateAppConfig(@RequestBody AppConfigVO appConfigVO);

    @Operation(summary="提交问题和意见", description="")
    @PostMapping("/admin/issues/submit")
    @ResponseBody
    Result<Boolean> submitIssue(@RequestBody SubmitIssueVO vo);

    @Operation(summary="获取验证码", description="")
    @PostMapping("/admin/code/verification")
    @ResponseBody
    Result<VerificationCodeVO> verificationCode(@RequestBody VerificationCodeVO vo);

    @Operation(summary="检查验证码", description="")
    @PostMapping("/admin/code/verification/check")
    @ResponseBody
    Result<VerificationCodeCheckVO> verificationCodeCheck(@RequestBody VerificationCodeCheckVO vo);

    @Operation(summary="首页", description="")
    @PostMapping("/admin/firstPage")
    @ResponseBody
    Result<FirstPageVO> firstPage();
}
